package com.avengers.core.bean;


import com.avengers.core.bean.enums.SymbolEnum;
import com.avengers.core.kit.StringKit;

/**
 * @author yu.wang
 * @since 2025/6/5 16:45
 **/
public class TimerClassInfo {
    private final String jobNo;
    private final String jobName;
    private final String className;
    private final Long startNanoTime;
    private final Thread thread;

    private final String toString;

    public TimerClassInfo(String jobNo, String jobName, String className) {
        this.jobNo = jobNo;
        this.jobName = jobName;
        this.className = className;
        this.thread = Thread.currentThread();
        this.startNanoTime = System.nanoTime();
        toString = String.format("[%s]%s%s %s", this.thread.getName(), StringKit.isBlank(this.jobName) ? SymbolEnum.empty.string : String.format("[%s]", this.jobName), this.jobNo, this.className);
    }

    public String getJobNo() {
        return jobNo;
    }

    public String getJobName() {
        return jobName;
    }

    public String getClassName() {
        return className;
    }

    public Long getStartNanoTime() {
        return startNanoTime;
    }

    public Thread getThread() {
        return thread;
    }

    @Override
    public String toString() {
        return this.toString;
    }
}
